import numpy as np

A = np.array([[1, 2], [3, 4], [5, 6]])  # 3行2列
print('Output 1')
print(A)

x = [1, 2, 3]
X = np.matrix(x)  # 1行3列
print('Output 2')
print(X)

x = np.arange(1, 9)
print('Output 3')
print(x)
X = x.reshape(2, 4)  # 2行4列
print(X)

print('Output 4')
print(X[1, 2])  # 取第2行第3列的数据，下标是从0开始的
print(X[:, 3])  # 取第4列的数据

print('Output 5')
A = np.matrix([1, 2, 3, 4, 5])  # 矩阵运算建议用 np.matrix()
print(A)
print(A.T)  # 转置
